package com.siwei.eqi.pojo.entity.system;

import lombok.Data;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

@Data
public class SysRegion implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     *  自增主键
     */
    private Long id;

    /**
     *  名称
     */
    private String name;

    /**
     * 编码
      */

    private Long code;

    /**
     * 省份
     */
    private String province;

    /**
     * 地市
     */
    private String city;

    /**
     * 区县
     */
    private String regType;

    /**
     * 上级Code
     */
    private Long parentCode;


    private List<SysRegion> regions = new ArrayList<>();

    public List<SysRegion> getRegions() {
        return regions;
    }

    public void setRegions(List<SysRegion> regions) {
        this.regions = regions;
    }

    public void addRegion(SysRegion region) {
        this.regions.add(region);  // 添加子区域
    }
}
